﻿<UserControl x:Class="QuickMail.View.Controls.QmBalloon"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:tb="http://www.hardcodet.net/taskbar"
             x:Name="me"
             Height="275"
             Width="320">
    <UserControl.Resources>
        <ResourceDictionary Source="../../ResourceDictionary.xaml"/>
    </UserControl.Resources>
    <UserControl.Triggers>
        <EventTrigger RoutedEvent="tb:TaskbarIcon.BalloonShowing">
            <BeginStoryboard Storyboard="{StaticResource FadeIn}"
                             x:Name="FadeIn_BeginStoryboard" />
        </EventTrigger>
        <EventTrigger RoutedEvent="Mouse.MouseEnter">
            <StopStoryboard BeginStoryboardName="FadeIn_BeginStoryboard" />
            <BeginStoryboard x:Name="FadeBack_BeginStoryboard1"
                             Storyboard="{StaticResource FadeBack}" />
        </EventTrigger>
        <EventTrigger RoutedEvent="tb:TaskbarIcon.BalloonClosing">
            <BeginStoryboard Storyboard="{StaticResource FadeOut}"
                             x:Name="FadeOut_BeginStoryboard" />
        </EventTrigger>
    </UserControl.Triggers>

    <Grid x:Name="BalloonGrid" MouseEnter="BalloonGrid_MouseEnter">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <Grid x:Name="HeaderGrid" Background="Green">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>

            <Image Grid.Row="0" Grid.Column="0" Grid.RowSpan="2" x:Name="StatusImage" VerticalAlignment="Center" HorizontalAlignment="Center"
               Source="../../Resources/child_new_post-32w.png" Width="32" Height="32" Margin="10, 5"/>
            
            <TextBlock Grid.Row="0" Grid.Column="1" x:Name="TitleTextBlock" Foreground="White" FontSize="14"
                       Text="The letter was sent" TextTrimming="CharacterEllipsis"
                       FontWeight="DemiBold" Margin="5, 5, 5, 2" Visibility="Visible"/>
            <TextBlock Grid.Row="1" Grid.Column="1" x:Name="ResultTextBlock" 
                       Foreground="White" Text="" TextTrimming="CharacterEllipsis"
                       Margin="5, 2, 5, 5" Visibility="Visible"/>


            <Button Grid.Row="0" Grid.Column="2" Grid.RowSpan="2" Width="25" Height="25" 
                            Click="CloseBalloon_OnClick" ToolTip="Close"
                            HorizontalAlignment="Right" VerticalAlignment="Top" Margin="5">
                <Image Source="../../Resources/delete_sign-32.png" Margin="-3"/>
            </Button>

        </Grid>

        <Grid Grid.Row="1" Background="#086F9E">
            <!--<Grid x:Name="grid" MouseEnter="grid_MouseEnter" Background="#C83400">-->
            <!--<Grid x:Name="grid" MouseEnter="grid_MouseEnter" Background="#B20000"> avast-->
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="*"/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>

            <TextBlock Grid.Row="0" Grid.Column="0" x:Name="TitleFromTextBlock" Foreground="White" Text="From: " Margin="5, 5, 5, 0" Visibility="Visible"/>
            <TextBlock Grid.Row="0" Grid.Column="1" x:Name="FromTextBlock" Foreground="White" Text="sample@mailaddress" TextTrimming="CharacterEllipsis"
                   FontWeight="DemiBold" Margin="5, 5, 5, 0" Visibility="Visible"/>

            <TextBlock Grid.Row="1" Grid.Column="0" x:Name="TitleToTextBlock" Foreground="White" Text="To: " Margin="5" Visibility="Visible"/>
            <TextBlock Grid.Row="1" Grid.Column="1" x:Name="ToTextBlock" Foreground="White" Text="sample@mailaddress" TextTrimming="CharacterEllipsis"
                   FontWeight="DemiBold" Margin="5, 5, 5, 0" Visibility="Visible"/>

            <TextBlock Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" x:Name="SubjecTextBlock" Margin="5, 0"
                   FontWeight="DemiBold"
                   Text="This is sample of letter subject"
                   FontSize="16" Foreground="White"
                   HorizontalAlignment="Center"
                   TextTrimming="CharacterEllipsis"/>

            <Rectangle Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="2" Fill="White" Height="1" Margin="5, 2"></Rectangle>

            <ScrollViewer Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="2" 
                      HorizontalScrollBarVisibility="Auto" 
                      VerticalScrollBarVisibility="Disabled" Margin="5, 5, 5, 0">
                <StackPanel x:Name="AttachmentsStackPanel" Orientation="Horizontal"/>
            </ScrollViewer>

            <Grid Grid.Row="5" Grid.Column="0" Grid.ColumnSpan="2">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>

                <Button Grid.Column="0" Margin="5" Height="35" Click="ReadLetter_OnClick">
                    <StackPanel Orientation="Horizontal">
                        <Image Source="../../Resources/read_message-32.png" Margin="5, 0"/>
                        <TextBlock x:Name="ReadLetterTextBlock" Text="READ LETTER" FontSize="12" VerticalAlignment="Center"/>
                    </StackPanel>
                </Button>

                <Button Grid.Column="1" Margin="5" Height="35" Click="OpenFolder_OnClick">
                    <StackPanel Orientation="Horizontal">
                        <Image Source="../../Resources/opened_folder-32.png" Margin="5, 0"/>
                        <TextBlock x:Name="OpenFolderTextBlock" Text="OPEN FOLDER" FontSize="12" VerticalAlignment="Center"/>
                    </StackPanel>
                </Button>
            </Grid>
        </Grid>
    </Grid>
</UserControl>
